/* --- Global Styles & Variables --- */
:root {
    --bg-color-dark: #000010;
    --text-color-dark: #e0e0ff;
    --accent-color-primary: #00aaff;
    --accent-color-secondary: #ffaa00;
    --card-bg-dark: rgba(10, 20, 40, 0.85); /* Slightly more opaque */
    --glow-color: rgba(0, 170, 255, 0.7);
    --nebula-color-1: rgba(100, 0, 150, 0.3);
    --nebula-color-2: rgba(0, 100, 150, 0.3);

    --bg-color-light: #f0f8ff;
    --text-color-light: #1a1a2e;
    --card-bg-light: rgba(255, 255, 255, 0.9);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color-dark); /* Fallback */
    color: var(--text-color-dark);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative; /* Needed for canvas positioning */
    min-height: 100vh;
}

/* Removed body.light-mode background/color override */

/* --- 3D Background Canvas --- */
#bg-canvas {
    position: fixed; /* Stick to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full viewport height */
    z-index: -1; /* Place behind all other content */
    display: block; /* Remove potential extra space */
    background-color: var(--bg-color-dark); /* Ensure canvas has base dark color */
}
/* Removed body.light-mode #bg-canvas hiding rule */


/* --- Navigation / Header --- */
#main-nav {
    position: fixed; /* Changed from fixed */
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 16, 0.7);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    z-index: 1000; /* Above content and canvas */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--accent-color-primary);
}
/* Removed body.light-mode #main-nav background override */

#main-nav ul {
    list-style: none;
    display: flex;
    margin: 0; padding: 0; /* Reset list margin/padding */
}

#main-nav ul li {
    margin: 0 15px;
}

#main-nav ul li a {
    color: var(--text-color-dark);
    font-weight: bold;
    text-decoration: none;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}
/* Removed body.light-mode #main-nav ul li a color override */

#main-nav ul li a:hover,
#main-nav ul li a.active { /* Style for active link */
    color: var(--accent-color-secondary);
    border-bottom-color: var(--accent-color-secondary);
}
/* Removed body.light-mode #main-nav ul li a:hover/active override */


/* Removed .theme-toggle-button styles */


/* --- Main Content Area --- */
main {
    padding-top: 80px; /* Account for fixed header height */
    padding-bottom: 60px; /* Space before footer */
    position: relative; /* Ensure content stacks above canvas */
    z-index: 1;
}

section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 40px auto; /* Give space between sections */
    background-color: var(--card-bg-dark); /* Ensure readability over 3D bg */
    border-radius: 8px;
    border: 1px solid rgba(0, 170, 255, 0.3);
    opacity: 0; /* Initially hidden for GSAP ScrollTrigger */
    transform: translateY(30px); /* Initial offset */
}
/* Removed body.light-mode section background override */

/* Special case for homepage hero section */
#home-page main section#home-content {
    min-height: calc(100vh - 80px - 60px); /* Fill viewport below nav/footer */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: transparent; /* Make homepage hero transparent over canvas */
    border: none;
    padding: 20px;
    margin-top: 0; /* Remove top margin for hero */
    opacity: 1; /* Make visible by default */
    transform: none;
}

#home-page #home-content h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: #fff; /* Make prominent */
    text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color);
}
/* Removed body.light-mode #home-page #home-content h1 override */

#home-page #home-content p {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

#home-page #home-content #typed-intro {
    font-size: 1.2rem;
    color: var(--accent-color-secondary);
    min-height: 40px; /* Prevent layout shift during typing */
}
/* Removed body.light-mode #home-page #home-content #typed-intro override */

/* General Section Headers & Content */
h1, h2, h3 {
    color: var(--accent-color-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 5px var(--glow-color);
}
/* Removed body.light-mode h1, h2, h3 override */

h2 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--accent-color-secondary);
    display: inline-block;
    padding-bottom: 0.3em;
    margin-bottom: 1.5rem;
}

p, li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

a {
    color: var(--accent-color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent-color-primary);
}
/* Removed body.light-mode a override */
/* Removed body.light-mode a:hover override */

ul {
    list-style: none; /* Remove default bullets */
    padding-left: 0;
}

/* Card-like styling for content blocks */
.card {
     /* Already applied to section, but can be used inside sections too */
     background-color: rgba(10, 25, 50, 0.8); /* Slightly different inner card bg */
     padding: 1.5rem;
     margin-bottom: 1.5rem;
     border-radius: 6px;
     border: 1px solid rgba(0, 170, 255, 0.2);
}
/* Removed body.light-mode .card override */

/* Specific styles for experience/projects */
.job, .project-item {
    border-left: 3px solid var(--accent-color-primary);
    padding-left: 15px;
    margin-bottom: 2rem;
}
.job h4, .project-item h4 {
    font-size: 1.3rem;
    color: var(--text-color-dark);
    margin-bottom: 0.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Removed body.light-mode .job h4, .project-item h4 override */
.job .duration, .project-item .duration {
    font-size: 0.9rem; font-style: italic; color: #aaa;
}
/* Removed body.light-mode .job .duration, .project-item .duration override */
.job .company, .project-item .tech-stack {
    font-weight: bold; color: var(--accent-color-primary); margin-bottom: 0.5rem;
}
/* Removed body.light-mode .job .company, .project-item .tech-stack override */
.job ul, .project-item ul { list-style: disc; margin-left: 20px; margin-top: 0.5rem; }


/* Orbiting Rocket Section */
#orbit-section {
    height: 200vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#orbit-container {
    position: relative;
    width: 300px;
    height: 300px;
}

#orbit-container img#mars {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

#orbit-container .orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    margin: -110px 0 0 -110px;
    pointer-events: none;
}

#orbit-container .orbit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: 50%;
}

#orbit-container #rocket {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

#equations {
    text-align: center;
}

#equations .equation {
    font-size: 1.2rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 20px;
    margin-top: auto; /* Push footer down */
    border-top: 1px solid var(--accent-color-primary);
    font-size: 0.9rem;
    color: #aaa;
    position: relative; /* Ensure footer is above canvas */
    z-index: 1;
    background-color: var(--bg-color-dark); /* Give footer solid background */
}
/* Removed body.light-mode footer override */

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #home-page #home-content h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    #home-page #home-content p { font-size: 1.1rem; }

    #main-nav { flex-direction: column; align-items: flex-start; padding: 10px; }
    #main-nav ul { margin-top: 10px; flex-direction: column; align-items: flex-start; width: 100%; }
    #main-nav ul li { margin: 5px 0; width: 100%; }
    #main-nav ul li a { display: block; padding: 8px 5px; width: 100%; }
     /* Removed .theme-toggle-button positioning */

    main { padding-top: 120px; } /* Adjust for taller mobile header */
    section { padding: 40px 15px; margin: 20px auto; }
     #home-page main section#home-content { min-height: calc(100vh - 120px - 60px); }

}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #bg-canvas { display: none !important; } /* Hide 3D background */
  body { background-color: var(--bg-color-dark); } /* Ensure fallback */
  /* Removed body.light-mode background override */
}